<template>
  <div class="duty flex">
    <div class="d-left">
      <img :src="require(`../../assets/images/${dObj.imgsrc}`)" alt="" />
      <div>总数</div>
    </div>
    <div class="flex">
      <div
        class="smallbox"
        v-for="(i, index) in dObj.num.toString().split('')"
        :key="index"
      >
        <p :style="{ 'animation-duration': `${0.5 * index+1}s` }">
          <!-- <span v-for="(h, c) in Number(i)" :key="h + c">{{ h - 1 }}</span>
          <span>{{ i }}</span> -->
          <span v-for="(h, c) in 10" :key="h + c">{{ h - 1 }}</span>
          <span>{{ i }}</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    dObj: {
      type: Object,
      default: {},
    },
  },
};
</script>

<style lang="scss" scoped>
.duty {
  width: 100%;
  height: 100%;
  .d-left {
    width: 30%;
    height: 100%;
    transform: translateX(-1.5625rem) translateY(-10px);
    img {
      height: 140%;
      margin-bottom: -15px;
    }
    & + div {
      flex: 1;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
    }
  }
  .smallbox {
    width: 20%;
    height:3.75rem;
    background: url(../../assets/images/dbackground.png) no-repeat center center;
    background-size: contain;
    display: block;
    font-size: 2.375rem;
    color: #66ffff;
    font-weight: 700;
    overflow: hidden;
    p {
      display: block;
      animation-name: move;
      animation-fill-mode: forwards;
      // animation: move 2s forwards;
      span {
        display: block;
        width: 100%;

        line-height: 3.75rem;
        &:last-of-type {
          animation: movedown 2s forwards;
        }
      }
    }
  }
  @keyframes move {
    0% {
    }
    100% {
      transform: translateY(-100%);
    }
  }
  @keyframes movedown {
    0% {
    }
    100% {
      transform: translateY(100%);
    }
  }
}
</style>
